<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layui=""
      th:replace="pages/common/main :: layout(~{::title}, ~{::section}, ~{}, ~{::script})">
    <head>
        <title>字典</title>
    </head>
    <body>
        <section>

            <div class="layui-fluid">

                <div class="layui-card">
                    <div class="layui-card-body">
                        <div th:insert="~{pages/modular/unicomjs/order/_search::search}"></div>
                        <table id="order-table" lay-filter="order-table-filter"></table>
                    </div>
                </div>

            </div>

        </section>

        <script th:inline="javascript">

            layui.use(["grid", "form", "ax", "jquery", "admin"], function () {
                var grid = layui.grid,
                    form = layui.form;

                var dicttype = {}
                    , col = [
                    {field: 'id', title: '订单号'},
                    {field: 'userName', title: '姓名(收)'},
                    {field: 'userPhone', title: '电话(收)'},
                    {field: 'userPostcode', title: '区县(收)'},
                    {field: 'userAddress', title: '地址(收)'},
                    {field: 'userIdent', title: '入网姓名'},
                    {field: 'userIdentNumber', title: '入网证件'},
                    {field: 'goodId', title: '商品编码'},
                    {field: 'province', title: '号码省份'},
                    {field: 'city', title: '号码地市'},
                    {field: 'phone', title: '号码'},
                    {field: 'uuid', title: '触点编码'},
                    // {field: 'areaCode', title: '下单发展人编码'}
                ];


                dicttype.table = {
                    height: "full-98",
                    url: Kong.ctxPath + "/unicomjs/order/list",
                    method: "post",
                    cols: [col],
                    defaultToolbar: ["filter", "print",
                        {
                            "title": "导出Excel",
                            "layEvent": "outputExcel",
                            "icon": "layui-icon-export"
                        }
                    ]
                };

                dicttype.eventOptions = {
                    outputExcel: {
                        url: "/unicomjs/order/excel-list",
                        filename: "省市区编码",
                        header: {
                            id:"外围订单号",
                            userName: "收货人姓名",
                            userPhone: "收货人联系电话",
                            userPostcode: "收货人所在区县",
                            userAddress: "收货人详细地址",
                            userIdent: "入网身份证姓名",
                            userIdentNumber: "入网身份证证件号码",
                            goodId: "商品编码",
                            province: "号码归属省份",
                            city: "号码归属地市",
                            phone: "订购号码",
                            uuid: "触点编码",
                            createTime: "订单创建时间"
                        }
                    }
                }

                var options = {
                        tableId: "order-table",
                        tableFilter: "order-table-filter",
                        table: dicttype.table,
                        eventOptions: dicttype.eventOptions
                    },
                    events = {};

                grid.render(options, events);

            });

        </script>


    </body>
</html>
